# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test_suite")

package(default_visibility = ["//visibility:public"])

filegroup(
    name = "all_srcs",
    srcs = glob(["**"]),
)

rust_library(
    name = "iceoryx2-cal-conformance-tests",
    srcs = glob(["src/**/*.rs"]),
    proc_macro_deps = [
        "//iceoryx2-bb/conformance-test-macros:iceoryx2-bb-conformance-test-macros",
    ],
    deps = [
        "//iceoryx2-bb/container:iceoryx2-bb-container",
        "//iceoryx2-bb/elementary-traits:iceoryx2-bb-elementary-traits",
        "//iceoryx2-bb/memory:iceoryx2-bb-memory",
        "//iceoryx2-bb/posix:iceoryx2-bb-posix",
        "//iceoryx2-bb/system-types:iceoryx2-bb-system-types",
        "//iceoryx2-bb/testing:iceoryx2-bb-testing",
        "//iceoryx2-cal",
        "//iceoryx2-pal/concurrency-sync:iceoryx2-pal-concurrency-sync",
        "//iceoryx2-pal/posix:iceoryx2-pal-posix",
        "//iceoryx2-pal/testing:iceoryx2-pal-testing",
        "@crate_index//:lazy_static",
        "@crate_index//:serde",
    ],
)

rust_test_suite(
    name = "iceoryx2-cal-conformance-tests-tests",
    srcs = glob(["tests/**/*.rs"]),
    crate_features = ["std"],
    deps = [
        ":iceoryx2-cal-conformance-tests",
        "//iceoryx2-bb/lock-free:iceoryx2-bb-lock-free",
        "//iceoryx2-bb/testing:iceoryx2-bb-testing",
        "//iceoryx2-cal",
        "//iceoryx2-pal/concurrency-sync:iceoryx2-pal-concurrency-sync",
        "@crate_index//:postcard",
        "@crate_index//:toml",
    ],
)
